<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict" xmlns:gr="http://www.google.com/schemas/reader/atom/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom">
  <xsl:output method="xml" indent="yes" encoding="UTF-8"/>

  <xsl:template match="text()"/>

  <xsl:template match="/">
    <rss version="2.0"> 
      <xsl:apply-templates/>
    </rss> 
  </xsl:template>

  <xsl:template match="atom:feed">

    <channel xmlns:itunes="http://www.itunes.com/DTDs/Podcast-1.0.dtd">          
      <title> <xsl:value-of select="atom:title"/> </title>
      <description> <xsl:value-of select="atom:title"/> </description>
      <itunes:summary> <xsl:value-of select="atom:title"/> </itunes:summary>
      <itunes:author> <xsl:value-of select="atom:author/atom:name"/> </itunes:author>

      <link> <xsl:value-of select="atom:link/@href"/> </link>
      <generator> <xsl:value-of select="atom:generator"/> </generator>
      <itunes:explicit>no</itunes:explicit>
      <pubDate> <xsl:value-of select="atom:updated"/> </pubDate>
      <lastBuildDate> <xsl:value-of select="atom:updated"/> </lastBuildDate>

      <xsl:apply-templates/>
    </channel>          
  </xsl:template>

  <xsl:template match="atom:entry">
    <item xmlns:itunes="http://www.itunes.com/DTDs/Podcast-1.0.dtd">          
      <title> <xsl:value-of select="atom:title"/> </title>
      <itunes:subtitle> <xsl:value-of select="atom:title"/> </itunes:subtitle>

      <itunes:summary> <xsl:value-of select="atom:title"/> </itunes:summary>
      <author> <xsl:value-of select="atom:author/atom:name"/> </author>
      <itunes:author> <xsl:value-of select="atom:author/atom:name"/> </itunes:author>
      <pubDate> <xsl:value-of select="atom:updated"/> </pubDate>
      <guid> <xsl:value-of select="atom:id/@gr:original-id"/> </guid>

      <xsl:apply-templates/>
    </item>
  </xsl:template>

  <xsl:template match="atom:link[@rel = 'enclosure']">
    <enclosure>
      <xsl:attribute name="url">  <xsl:value-of select="@href"/>  </xsl:attribute>
      <xsl:attribute name="type">  <xsl:value-of select="@type"/>  </xsl:attribute>

      <xsl:attribute name="length">  <xsl:value-of select="@length"/>  </xsl:attribute>
    </enclosure>
  </xsl:template>

</xsl:stylesheet>